﻿using UFSoft.UBF.MD;

namespace UFSoft.UBF.Cust.ClassView.MVC.Metedata
{
    public class AssociationDTO : ElementDTO
    {
        public KeyDTO ParentEntityKey { get; set; }
        public KeyDTO ChildEntityKey { get; set; }
        public KeyDTO ParentMemberKey { get; set; }
        public KeyDTO ChildMemberKey { get; set; }
        public EnumCardinality ParentCardinality { get; set; }
        public EnumCardinality ChildCardinality { get; set; }
        public bool IsCascadeDelete { get; set; }
        public EnumCascadeRule CascadeDeleteRule { get; set; }
        public bool IsCascadeUpdate { get; set; }
        public bool IsEnableCascadeValidation { get; set; }
        public EnumCascadeRule CascadeUpdateRule { get; set; }
        public EnumAssociationKind Kind { get; set; }
        public EnumAssociationDirection Direction { get; set; }
        public string ParentMemberName { get; set; }
        public string ChildMemberName { get; set; }

        /// <summary>
        ///     子实体是否有子实体
        /// </summary>
        public bool ChildEntityHasChildren { get; set; }

        /// <summary>
        ///     子实体表名
        /// </summary>
        public string ChildEntityTableName { get; set; }
    }
}